package com.kuang.demo.controller.wx;

import com.kuang.demo.bean.BaseRespVo;
import com.kuang.demo.bo.zzywx.user.MyOrder;
import com.kuang.demo.bo.zzywx.user.ReOrder;
import com.kuang.demo.service.wx.WXUserService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/wx/user")
@RestController
public class WXUserController {
    @Autowired
    WXUserService wxUserService;

    @RequestMapping("/index")
    public BaseRespVo zzy1(){
        Subject subject = SecurityUtils.getSubject();
        String  principal = (String) subject.getPrincipal();

        MyOrder order = wxUserService.selectAllOrder(principal);
        ReOrder reOrder = new ReOrder();
        reOrder.setOrder(order);

        return BaseRespVo.ok(reOrder);
    }
}
